#include <cmath>
#include <iostream>
using namespace std;

inline long double f(long double y, long double x)
{
    long double r = y * log(x) - x * log(y);
    return r;
}

inline long double ddx_f(long double y, long double x)
{
    long double r = log(x) - x / y;
    if (abs(r) < 1e-8)
        return 0.1;
    return r;
}

inline long double newton(long double yn, long double x)
{
    long double d = f(yn, x) / ddx_f(yn, x);
    long double r = yn - d;
    if (r < 0.0)
        r = -r;
    return r;
}

int main()
{
    int n;
    long double x, y, y0;
    scanf("%d", &n);
    while (n--)
    {
        scanf("%llf", &x);

        if (x < 2.718281828)
            y = y0 = 10;
        else
            y = y0 = 0.1;

        do
        {
            y0 = y;
            y = newton(y, x);
        } while (abs(y - y0) > 1e-6);

        y = newton(y, x);

        printf("%.4llf\n", y);
    }
    return 0;
}